package com.system

/**
 * 文件资源
 */
class FileResource {

    //文件编号
    String uuid

    //原文件名
    String oldName

    //新文件名
    String newName

    //相对路径
    String relPath

    //绝对路径
    String absolutePath

    FileResource(String oldName, String newName, String relPath, String absolutePath) {
        this.uuid = UUID.randomUUID().toString()
        this.oldName = oldName
        this.newName = newName
        this.relPath = relPath
        this.absolutePath = absolutePath
    }

    static constraints = {

        uuid unique: true

    }

    static mapping = {
        version false
    }

    def beforeInsert() {
        uuid = UUID.randomUUID().toString()
    }
}
